﻿<s:SurfaceUserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/surface/2008" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:local="clr-namespace:OficinaTuristicaFE.Controls"
    xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic"
    x:Name="surfaceUserControl" 
	mc:Ignorable="d" x:Class="OficinaTuristicaFE.Controls.BusinessCard"	
        d:DataContext="{d:DesignData SampleData/VCardSampleData.xaml}"
    >
    <s:SurfaceUserControl.Resources>
        <Style x:Key="BussinessCardStyle_Leisure" TargetType="{x:Type StackPanel}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="BusinessCard Backgrounds/BCLeisure.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BusinessCardStyle_GetRouteIcon" TargetType="{x:Type s:SurfaceButton}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="Icons/IconGetRoute02.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BusinessCardStyle_CloseIcon" TargetType="{x:Type s:SurfaceButton}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="Icons/iconClose.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BusinessCardStyle_InformationIcon" TargetType="{x:Type s:SurfaceButton}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="Icons/iconInfo02.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BusinessCardStyle_ShowOnMapIcon" TargetType="{x:Type s:SurfaceButton}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="Icons/ShowOnMapButton.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BussinessCardStyle_Lodging" TargetType="{x:Type StackPanel}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="BusinessCard Backgrounds/BCLodging.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BussinessCardStyle_Bars_Restaurants" TargetType="{x:Type StackPanel}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="BusinessCard Backgrounds/BCRestaruant.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BussinessCardStyle_Routes" TargetType="{x:Type StackPanel}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="BusinessCard Backgrounds/BCRoute.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BussinessCardStyle_PrivateServices" TargetType="{x:Type StackPanel}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="BusinessCard Backgrounds/BCServices.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BussinessCardStyle_Shopping" TargetType="{x:Type StackPanel}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="BusinessCard Backgrounds/BCShopping.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BussinessCardStyle_Sports" TargetType="{x:Type StackPanel}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="BusinessCard Backgrounds/BCSports.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BussinessCardStyle_TelephoneOfInterest" TargetType="{x:Type StackPanel}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="BusinessCard Backgrounds/BCTelephone.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BussinessCardStyle_PointsOfTouristInterest" TargetType="{x:Type StackPanel}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="BusinessCard Backgrounds/BCTouristInterest.png"/>
                </Setter.Value>
            </Setter>
            <Setter Property="Orientation" Value="Horizontal"/>
        </Style>
        <Style x:Key="BussinessCardStyle_Transport" TargetType="{x:Type StackPanel}">
            <Setter Property="Background" >
                <Setter.Value>
                    <ImageBrush ImageSource="BusinessCard Backgrounds/BCTransports.png"/>
                </Setter.Value>
            </Setter>
        </Style> 
    	<ControlTemplate x:Key="TransparentButton" TargetType="{x:Type ButtonBase}">
    		<ControlTemplate.Resources>
    			<Storyboard x:Key="Press">
    				<DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Glow">
    					<SplineDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
    				</DoubleAnimationUsingKeyFrames>
    				<ThicknessAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="Glow">
    					<SplineThicknessKeyFrame KeyTime="0:0:0.1" Value="-3"/>
    				</ThicknessAnimationUsingKeyFrames>
    			</Storyboard>
    			<Storyboard x:Key="Release">
    				<DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Glow">
    					<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    					<SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="0:0:0.5" Value="0"/>
    				</DoubleAnimationUsingKeyFrames>
    				<ThicknessAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="Glow">
    					<SplineThicknessKeyFrame KeyTime="0" Value="-3"/>
    					<SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="0:0:0.5" Value="1"/>
    				</ThicknessAnimationUsingKeyFrames>
    			</Storyboard>
    		</ControlTemplate.Resources>
    		<Grid x:Name="Grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
    			<Border x:Name="Shadow" BorderBrush="{x:Null}" BorderThickness="0,0,0,1" CornerRadius="6" Margin="1,1,1,0" Padding="1" Opacity="0"/>
    			<Rectangle x:Name="Base" Fill="{TemplateBinding Background}" Margin="1" RadiusY="5" RadiusX="5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" StrokeThickness="1" Stroke="{x:Null}"/>
    			<Rectangle x:Name="RenderOverlay" Margin="2" Opacity="0" RadiusY="4" RadiusX="4" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" StrokeThickness="1">
    				<Rectangle.Fill>
    					<LinearGradientBrush EndPoint="0,0" StartPoint="0,1">
    						<GradientStop Color="#26000000" Offset="0"/>
    						<GradientStop Color="#4CFFFFFF"/>
    					</LinearGradientBrush>
    				</Rectangle.Fill>
    			</Rectangle>
    			<Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" Color="White" CornerRadius="4" Margin="1" Opacity="0"/>
    			<ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Opacity="0">
    				<ContentPresenter.RenderTransform>
    					<TranslateTransform X="0" Y="-1"/>
    				</ContentPresenter.RenderTransform>
    			</ContentPresenter>
    		</Grid>
    		<ControlTemplate.Triggers>
    			<Trigger Property="IsPressed" Value="True">
    				<Trigger.EnterActions>
    					<BeginStoryboard>
    						<Storyboard>
    							<DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Glow">
    								<SplineDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
    							</DoubleAnimationUsingKeyFrames>
    							<ThicknessAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="Glow">
    								<SplineThicknessKeyFrame KeyTime="0:0:0.1" Value="-3"/>
    							</ThicknessAnimationUsingKeyFrames>
    						</Storyboard>
    					</BeginStoryboard>
    				</Trigger.EnterActions>
    				<Trigger.ExitActions>
    					<BeginStoryboard>
    						<Storyboard>
    							<DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Glow">
    								<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    								<SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="0:0:0.5" Value="0"/>
    							</DoubleAnimationUsingKeyFrames>
    							<ThicknessAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="Glow">
    								<SplineThicknessKeyFrame KeyTime="0" Value="-3"/>
    								<SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="0:0:0.5" Value="1"/>
    							</ThicknessAnimationUsingKeyFrames>
    						</Storyboard>
    					</BeginStoryboard>
    				</Trigger.ExitActions>
    			</Trigger>
    			<Trigger Property="IsEnabled" Value="True"/>
    			<Trigger Property="IsEnabled" Value="False">
    				<Setter Property="Fill" TargetName="RenderOverlay" Value="#0CFFFFFF"/>
    				<Setter Property="Stroke" TargetName="RenderOverlay" Value="#33FFFFFF"/>
    				<Setter Property="Stroke" TargetName="Base" Value="#33000000"/>
    				<Setter Property="BorderBrush" TargetName="Shadow" Value="#00000000"/>
    				<Setter Property="Foreground" Value="#A5333333"/>
    				<Setter Property="Background" Value="Transparent"/>
    			</Trigger>
    		</ControlTemplate.Triggers>
    	</ControlTemplate>
    	<ControlTemplate x:Key="SurfaceButtonControlTemplateMap" TargetType="{x:Type s:SurfaceButton}">
    		<Grid Background="{x:Null}"/>
    	</ControlTemplate>
    	<ControlTemplate x:Key="ShowOnMapStyleTemplate" TargetType="{x:Type s:SurfaceButton}">
    		<Grid>
    			<Grid.Background>
    				<ImageBrush ImageSource="ShowOnMapButton.png"/>
    			</Grid.Background>
    		</Grid>
    	</ControlTemplate>
    	<ControlTemplate x:Key="GetRouteStyleTemplate" TargetType="{x:Type s:SurfaceButton}">
    		<Grid>
    			<Grid.Background>
    				<ImageBrush ImageSource="Icons/IconGetRoute02.png"/>
    			</Grid.Background>
    		</Grid>
    	</ControlTemplate> 
    </s:SurfaceUserControl.Resources>
    <StackPanel x:Name="BusinessCardContainer" Style="{StaticResource BussinessCardStyle_Leisure}" Margin="-10" MaxHeight="200" MinHeight="100" MaxWidth="400" MinWidth="200">    	
    	<Grid>
    		<Grid.RowDefinitions>
    			<RowDefinition Height="33"/>
    			<RowDefinition Height="33"/>
    			<RowDefinition Height="33"/>
    			<RowDefinition Height="33"/>
    			<RowDefinition Height="34"/>
    			<RowDefinition Height="34"/>
    		</Grid.RowDefinitions>
    		<Grid.ColumnDefinitions>
    			<ColumnDefinition Width="360"/>
    			<ColumnDefinition Width="40"/>
    		</Grid.ColumnDefinitions>
    		<s:SurfaceButton x:Name="CloseButton" Grid.Column="2" Grid.Row="0" Style="{StaticResource BusinessCardStyle_CloseIcon}" Click="CloseButton_Click" Template="{StaticResource TransparentButton}" Width="30" Height="30" RenderTransformOrigin="0.5,0.5">
    			<s:SurfaceButton.RenderTransform>
    				<TransformGroup>
    					<ScaleTransform/>
    					<SkewTransform/>
    					<RotateTransform/>
    					<TranslateTransform Y="5" X="-2"/>
    				</TransformGroup>
    			</s:SurfaceButton.RenderTransform>
    		</s:SurfaceButton>
    		<s:SurfaceButton x:Name="InformationButton" Grid.Column="2" Grid.Row="1" Style="{StaticResource BusinessCardStyle_InformationIcon}" Click="InformationButton_Click" Template="{StaticResource TransparentButton}" Width="30" Height="30" RenderTransformOrigin="0.5,0.5">
    			<s:SurfaceButton.RenderTransform>
    				<TransformGroup>
    					<ScaleTransform/>
    					<SkewTransform/>
    					<RotateTransform/>
    					<TranslateTransform Y="5" X="-2"/>
    				</TransformGroup>
    			</s:SurfaceButton.RenderTransform>
    		</s:SurfaceButton>
            <s:SurfaceButton x:Name="ShowOnMapButton" Grid.Column="2" Grid.Row="2" Click="ShowOnMap_Click" Template="{DynamicResource ShowOnMapStyleTemplate}" Width="30" Height="30" RenderTransformOrigin="0.5,0.5" Background="{x:Null}">
    			<s:SurfaceButton.RenderTransform>
    				<TransformGroup>
    					<ScaleTransform/>
    					<SkewTransform/>
    					<RotateTransform/>
    					<TranslateTransform Y="5" X="-2"/>
    				</TransformGroup>
    			</s:SurfaceButton.RenderTransform>
    		</s:SurfaceButton>
    		<s:SurfaceButton x:Name="PrintButton" Grid.Column="2" Grid.Row="3" Background="{StaticResource PrintIconStyle}" Foreground="{x:Null}" Click="PrintButton_Click"  Template="{StaticResource TransparentButton}" Width="30" Height="30" RenderTransformOrigin="0.5,0.5">
    			<s:SurfaceButton.RenderTransform>
    				<TransformGroup>
    					<ScaleTransform/>
    					<SkewTransform/>
    					<RotateTransform/>
    					<TranslateTransform Y="5" X="-2"/>
    				</TransformGroup>
    			</s:SurfaceButton.RenderTransform>
    		</s:SurfaceButton>
    		<s:SurfaceButton x:Name="MailMapButton" Grid.Column="2" Grid.Row="4" Background="{StaticResource SendMailIconStyle}" Foreground="{x:Null}" Click="MailMapButton_Click"  Template="{StaticResource TransparentButton}" Width="30" Height="30" RenderTransformOrigin="0.5,0.5">
    			<s:SurfaceButton.RenderTransform>
    				<TransformGroup>
    					<ScaleTransform/>
    					<SkewTransform/>
    					<RotateTransform/>
    					<TranslateTransform Y="5" X="-2"/>
    				</TransformGroup>
    			</s:SurfaceButton.RenderTransform>
    		</s:SurfaceButton>
            
    		<Label Grid.Row="0" x:Name="Title" HorizontalAlignment="Left" VerticalAlignment="Center" Width="278" Height="31" Content="{Binding CompanyName}" 
    			FontSize="16" Foreground="Black" FontFamily="Verdana" FontWeight="Bold" FontStyle="Italic" Margin="25,8,0,8" />
    		<Grid Grid.Row="1" Grid.RowSpan="5">
    			<Grid.RowDefinitions>
    				<RowDefinition/>
    			</Grid.RowDefinitions>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="200"/>
    				<ColumnDefinition Width="200"/>
    			</Grid.ColumnDefinitions>
    			<StackPanel>
    				<s:SurfaceScrollViewer x:Name="Descripcion" Height="75" Grid.Column="0" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Visibility="Hidden">
    					<StackPanel>
    						<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Description}" VerticalAlignment="Top" Foreground="Black" Margin="25,0,0,0"/>
    					</StackPanel>
    				</s:SurfaceScrollViewer>
    				<TextBlock x:Name="Direccion" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Address}" VerticalAlignment="Top" Visibility="Hidden" Foreground="Black" Margin="25,0,0,0" Width="160"/>
    				<TextBlock x:Name="Telefono"  HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding PrimaryPhone}" VerticalAlignment="Top" Visibility="Hidden" Foreground="Black" Margin="25,0,0,0"/>
    				<TextBlock x:Name="PaginaWeb" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Web}" VerticalAlignment="Top" Visibility="Hidden" Foreground="Black" Margin="25,0,0,0"/>
    				<TextBlock x:Name="Mail" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Email}" VerticalAlignment="Top" Visibility="Hidden" Foreground="Black" Margin="25,0,0,0"/>
    			</StackPanel>
    			<Image x:Name="Foto" Height="150" Source="{Binding Image, ElementName=surfaceUserControl}" Visibility="Hidden" Grid.Column="1" Margin="0,0,54,0" />
    			<MediaElement Grid.ColumnSpan="2" LoadedBehavior="Pause" ScrubbingEnabled="True" Width="400" Height="150" x:Name="Video" Source="{Binding VideoSource}" Visibility="Visible"/>
    			<s:SurfaceButton x:Name="PauseButton" Width="20" HorizontalAlignment="Right" VerticalAlignment="Bottom" Padding="5" Click="OnPauseButtonPressed" Height="30">
    				<Image Source="Pause.png" IsHitTestVisible="False"/>
    			</s:SurfaceButton>
                <!-- Play -->
    			<s:SurfaceButton x:Name="PlayButton" Width="20" HorizontalAlignment="Left" VerticalAlignment="Bottom"  Grid.Column="1" Padding="5" Click="OnPlayButtonPressed" Height="30">
    				<Image Source="Play.png" IsHitTestVisible="False" />
    			</s:SurfaceButton>
    		</Grid>
    	</Grid>
    </StackPanel>

</s:SurfaceUserControl>
